#include <iostream>
#include <string.h>
#include <math.h>
using namespace std;


int main(){
	int n,m;
	cin>>n>>m;
	int a[n];
	int dp[n+1][m+1];
	memset(dp,0,sizeof(dp));
	dp[0][0] = 1;
	for(int i=0;i<n;i++)
		cin>>a[i];
	for(int i=1;i<=n;i++){
		dp[i][0] = 1;
		for(int j=1;j<=m;j++){
			dp[i][j] = j-a[i-1]>=0?dp[i-1][j]+dp[i-1][j-a[i-1]]:dp[i-1][j];
		}
	}
	cout<<dp[n][m];
	return 0;
}
